fix(key-vault): make Codex model discovery reliable - #677
Open
beruro wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Codex subscription credential detection could stay loading indefinitely. The npm Codex wrapper spawns a native app-server descendant, but the previous cleanup only killed the wrapper and then waited forever for inherited stderr pipes to close.
The same flow also allowed persisted
enabled_modelsto drift from the provider catalog inavailable_models. Different selectors then interpreted the same account differently, so refreshed GPT-5.6 models could appear in one surface but stale GPT-5.5 or GPT-5.4 rows remained in another. Auto-detection also lacked deterministic progress, success, timeout, and failure feedback.Solution
enabled_models ⊆ available_modelson save, hydration, and model refresh while preserving user order and removing duplicates.Potential risks
taskkill /T /Fand compiles, but runtime verification was performed on macOS only.libcis added as a direct dependency for Unix process-group termination.Verification
npx vitest run src/scaffold/WizardSystem/variants/KeyVault src/hooks/models/useModelAccountLookup.test.ts src/features/TeamCollaboration/forkModelFallback.test.ts src/modules/MainApp/AgentOrgs/components/cliManagedConfigUtils.test.ts src/scaffold/GlobalSpotlight/palettes/UnifiedModelPalette/useUnifiedModelPaletteItems.test.ts— 9 files, 46 tests passed.npx tsc --noEmit --pretty false— passed.cargo test --manifest-path src-tauri/crates/key-vault/Cargo.toml— 349 tests passed.cargo clippy --manifest-path src-tauri/crates/key-vault/Cargo.toml --all-targets -- -D warnings— passed.rustfmt --edition 2021 --checkover all changed Rust files — passed.git diff --checkand changed-diff secret, personal-path, debug-log, and conflict-marker scan — passed.cargo fmt --all --checkwas not used as the gate because unrelated files on currentdevelopare not rustfmt-clean; every Rust file changed by this PR passed direct rustfmt checks.Architecture audit
All 10 architecture-audit layers were covered; none were skipped. The call chain was traced from wizard auto-detect and login capture through OAuth catalog resolution, Key Vault save or refresh, hydration, and every changed model consumer.
available_modelsremains the authoritative provider catalog andenabled_modelsremains the user-selected subset. Save, load, and refresh now share the same normalization invariant, and all changed resolvers check the same available-and-enabled dimensions. Wire fields and serialization remain unchanged.UI audit
Frontend UI audit result: 0 fixes recommended, 2 keep-with-reason findings, and 0 abstraction candidates. The existing design-system Button and InlineAlert remain in use; progress uses a polite status region and failures use an assertive alert region.
No new screenshot or recording was captured because the user explicitly requested that this task not control or inspect the UI image. UI state behavior is covered by the reducer tests, full typecheck, ESLint, and the real backend catalog probe.
Performance guard